package cn.tfyhyc.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author 头发又黑又长
 * @Date 2022/10/7 15:32
 * @email zwb15083976291@163.com
 */

@RestController
@RequestMapping("/consumer")
public class OrderZkController {

    // 这里使用的是zookeeper中注册的服务地址名称
    public static final String INVOKE_URL = "http://cloud-provider-payment";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/payment/zk")
    public String paymentInfo() {
        return restTemplate.getForObject(INVOKE_URL + "/payment/zk", String.class);
    }

}
